package com.tianji.remark.controller.api;

import com.tianji.remark.entity.dto.LikeRecordFormDTO;
import com.tianji.remark.service.ILikedRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 点赞记录表 控制器 远程调用
 * </p>
 *
 * @author lemon
 */
@Api(tags = "点赞管理-远程调用")
@RestController
@RequiredArgsConstructor
@RequestMapping("/likes")
public class LikedRecordApiController {

    private final ILikedRecordService likedRecordService;

    /**
     * 判断当前用户是否对该业务点赞
     *
     * @param bizIds
     * @return
     */
    @ApiOperation("批量查询点赞状态")
    @GetMapping("list")
    public Set<Long> getLikesStatus(@RequestParam("bizIds") List<Long> bizIds) {
        // 这个是用数据做的
        // return likedRecordService.getLikesStatus(bizIds);

        // 这个是用redis做的
        return likedRecordService.getLikesStatusForRedis(bizIds);
    }
}
